package com.example.demo1

import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.mylibrary1.Lib1Demo
import com.example.mylibrary2.Lib2Demo

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        val view = findViewById<View>(R.id.main)
        val tv = findViewById<View>(R.id.tv)
        ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
        tv.setOnClickListener {
            Toast.makeText(this, Lib1Demo().demo("MainActivity"), Toast.LENGTH_SHORT).show()
            Toast.makeText(this, Lib2Demo().demo("MainActivity"), Toast.LENGTH_SHORT).show()
        }

    }

    override fun onResume() {
        super.onResume()
    }

}